package com.hitales.liteflow.liteflowdemo.booleandemo;

import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeBooleanComponent;

@LiteflowComponent("checkAge")
public class CheckAgeComponent extends NodeBooleanComponent {

    @Override
    public boolean processBoolean() {
        // 获取上下文
        CustomContext context = this.getContextBean(CustomContext.class);
        Object requestData = this.getRequestData();
        System.out.println("---------------"+requestData);
        // 判断年龄是否大于18
        boolean result = context.getAge() != null && context.getAge() >= 18;
        System.out.println("CheckAgeComponent 判断结果: " + result);
        return result;
    }
}

